Repository navigation
Report typed non-complete native guest states instead of invalid_output - #268
Merged
Merged
Conversation
The guest left Report nil on every non-complete finished record. As a json.RawMessage, nil encodes as the literal null, which decodes back to four bytes, so the host's valid() refused every typed guest failure (auth_failed, provider_unavailable, cancelled, ...) and classified the phase as invalid_output. The same decoding let a complete record carry a null report past valid(). Report is now omitted when absent. The host's exact re-encoding keeps that canonical: an explicit null is a carried value, which valid() refuses for every state. The host's classification of a decoded record is extracted as nativeVMFinished.failure. The guest and host binaries must both be rebuilt; a mixed pair fails closed. Tests encode records through the guest's own finish producer and the host's readVMRecord/failure path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record that the measured phase-invalid_output classes were the host's refusal of the guest's null report, which classes each refused case is expected to record after the fix, and that they still need a rebuilt guest image and runner to be measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #255.
Problem
For a non-complete state the guest left
nativeVMFinished.Reportnil. As ajson.RawMessagethat encodes as"Report":null; the host decoded the 4 bytesnull, its exact re-encoding check still matched, andvalid()refused every non-complete record because it requires an empty report. Every typed guest failure (auth_failed,provider_unavailable,incomplete_expired, …) therefore reached the host asinvalid_output, with the VM boot error attached. Acompleterecord with a null report also passedvalid().Change
Reportis taggedjson:",omitempty": the guest omits an absent report, and the host's exact re-encoding treats omission as canonical, so the wire format stays strict.nullis a carried value:valid()refuses it in every state, includingcomplete(stricter than before).nativeVMFinished.failure(q)with unchanged behaviour; a valid typed record becomesPhaseError{State}.NATIVE-VM.mddocuments the envelope rule;HOSTILE-FIXTURES.mdandEXHAUSTION-FIXTURES.mdexplain that earlierphase-invalid_outputclasses were the host's and record the classes measured after the fix.Evidence
TestNativeVMHostReceivesTypedGuestFailureAsEncodedByTheGuestruns the guest's realfinish()over a pipe, then the host'sreadVMRecordandfailure(), for both providers and every typed state;TestNativeVMFinishedRefusesReportsOutsideCompleteOverTheWirechecks the accepted and refused envelopes. Both fail on the old code (every state refused; a null-reportcompleteaccepted).a3c8dbdon mini (guest image, runner, source stub andreviewer.testbuilt from that commit; one VM at a time behind a ≥2.5 GB available-memory gate): exhaustion 12/12, withclaude-turn-floodnow recordingphase-incomplete_expiredinstead of the host'sphase-invalid_output; hostile 19 pass + the containedcodex-metadataclient failure (refused cases stillphase-invalid_output, now the guest's own classification); every E2E case passes includingclose-provider-recover(101 checks).go vet ./..., the Python suites andgo test -race ./...(reviewer package 247.125 s) pass.Both the guest (
nativevmguest/ native image) and every host binary that reads finished records change; a mismatched pair fails closed.🤖 Generated with Claude Code